package club.classload;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class Test {
public static void main(String args[]){
    fileMove("D:/myjava/com/gao/shan/HelloWord.class","D:/myjava/temp/HelloWord.class");
}
    public static void fileMove(String str,String dest){

    FileInputStream fis=null;
    FileOutputStream fos=null;
    try{
        File st=new File(str);
        File des=new File(dest);
        String a=dest.substring(0,dest.lastIndexOf("/"));
        System.out.println(a);
        new File(a).mkdir();
      des.createNewFile();
        fis=new FileInputStream(st);
        fos=new FileOutputStream(des);
        int temp=0;
        while((temp=fis.read())!=-1){
            fos.write(temp^0xff);
        }
    }catch (IOException e){
        e.printStackTrace();
    }

}
}
